<html>
<head>
	<meta charset="UTF-8">
	<meta content="IE=edge" http-equiv="X-UA-Compatible">
	<meta content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width" name="viewport">
	<title>2658：[Zjoi2012]小蓝的好友(mrx)</title>
	<!-- css -->
	<link href="../css/base.min.css" rel="stylesheet">
	<link href="../css/project.min.css" rel="stylesheet">
	
	<!-- favicon -->
	<!-- ... -->
</head>
<body class="page-brand">
	<header class="header header-transparent header-waterfall ui-header">
		<ul class="nav nav-list pull-left">
			<li>
				<a data-toggle="menu" href="#menu">
					<span class="icon icon-lg">menu</span>
				</a>
			</li>
		</ul>
		<a class="header-logo header-affix-hide margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">[Zjoi2012]小蓝的好友(mrx)</a>
		<span class="header-logo header-affix margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">[Zjoi2012]小蓝的好友(mrx)</span>
	</header>
	<nav aria-hidden="true" class="menu" id="menu" tabindex="-1">
		<div class="menu-scroll">
			<div class="menu-content">
				<a class="menu-logo" href="../index.html">BZOJ离线题库</a>
				<ul class="nav">
					<li>
						<a class="waves-attach" data-toggle="collapse" href="#problems">题目</a>
						<ul class="menu-collapse collapse in" id="problems">
							<li>
								<a class="waves-attach" href="../index.html">主页</a>
							</li>
							<li>
								<a class="waves-attach" href="../list.html">题目列表</a>
							</li>
						</ul>
					</li>
					<li>
						<a class="collapsed waves-attach" data-toggle="collapse" href="#about">关于</a>
						<ul class="menu-collapse collapse" id="about">
							<li>
								<a class="waves-attach" href="../about.html">关于此项目</a>
							</li>
						</ul>
					</li>
					
				</ul>
			</div>
		</div>
	</nav>
	<main class="content">
		<div class="content-header ui-content-header">
			<div class="container">
				<h1 class="content-heading">
                [Zjoi2012]小蓝的好友(mrx)                </h1>
                <p>时间限制：20s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  空间限制：128MB</p>			</div>
		</div>
		<div class="container">
			<section class="content-inner margin-top-no">
				<div class="row">
					<div class="col-lg-13 col-md-13">
						<div class="card margin-bottom-no">
							<div class="card-main">
								<div class="card-inner">
									
                                <h3>题目描述</h3><p><div style="line-height: 150%"><span style="font-size: medium"><span style="line-height: 150%">终于到达了这次选拔赛的最后一题，想必你已经厌倦了小蓝和小白的故事，为了回馈各位比赛选手，此题的主角是贯穿这次比赛的关键人物&mdash;&mdash;小蓝的好友。</span></span></div>
<div style="text-indent: 24pt; line-height: 150%"><span style="font-size: medium"><span style="line-height: 150%">在帮小蓝确定了旅游路线后，小蓝的好友也不会浪费这个难得的暑假。与小蓝不同，小蓝的好友并不想将时间花在旅游上，而是盯上了最近发行的即时战略游戏&mdash;&mdash;</span><span style="line-height: 150%">SangoCraft</span><span style="line-height: 150%">。但在前往通关之路的道路上，一个小游戏挡住了小蓝的好友的步伐。</span></span></div>
<div style="text-indent: 24pt; line-height: 150%"><span style="font-size: medium"><span style="line-height: 150%">&ldquo;国家的战争其本质是抢夺资源的战争&rdquo;是整款游戏的核心理念，这个小游戏也不例外。简单来说，用户需要在给定的长方形土地上选出一块子矩形，而系统随机生成了</span><span style="line-height: 150%">N</span><span style="line-height: 150%">个资源点，位于用户所选的长方形土地上的资源点越多，给予用户的奖励也越多。悲剧的是，小蓝的好友虽然拥有着极其优秀的能力，但同时也有着极差的</span><span style="line-height: 150%">RP</span><span style="line-height: 150%">，小蓝的好友所选的区域总是没有一个资源点。</span></span></div>
<div style="text-indent: 24pt; line-height: 150%"><span style="font-size: medium"><span style="line-height: 150%">终于有一天，小蓝的好友决定投诉这款游戏的制造厂商，为了搜集证据，小蓝的好友想算出至少包含一个资源点的区域的数量。作为小蓝的好友，这自然是你分内之事。</span></span></div>
<div style="line-height: 150%"><span style="font-size: medium">&nbsp;</span></div></p><hr/><h3>输入格式</h3><p><div style="text-indent: 26.25pt; line-height: 150%"><span style="font-size: medium">&nbsp;<span style="line-height: 150%">每个输入文件中仅包含一个测试数据。</span></span></div>
<div style="text-indent: 30pt; line-height: 150%"><span style="font-size: medium"><span style="line-height: 150%">第一行包含两个由空格隔开的正整数</span><span style="line-height: 150%">R,C,N</span><span style="line-height: 150%">，表示游戏在一块</span><span style="line-height: 150%">[1,R]X[1,C]</span><span style="line-height: 150%">的地图上生成了</span><span style="line-height: 150%">N</span><span style="line-height: 150%">个资源点。</span></span></div>
<div style="line-height: 150%"><span style="font-size: medium"><span style="line-height: 150%">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="line-height: 150%">接下来有</span><span style="line-height: 150%">N</span><span style="line-height: 150%">行，每行包含两个整数</span><span style="line-height: 150%"> x,y</span><span style="line-height: 150%">，表示这个资源点的坐标</span></span></div>
<div style="line-height: 150%"><span style="font-size: medium"><span style="line-height: 150%">(1&lt;=x&lt;=R,1&lt;=Y&lt;=c)</span><span style="line-height: 150%">。</span></span></div></p><hr/><h3>输出格式</h3><p><div style="line-height: 150%"><span style="font-size: medium">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="line-height: 150%">输出文件应仅包含一个整数，表示至少包含一个资源点的区域的数量。具体的说，设</span><span style="line-height: 150%">N</span><span style="line-height: 150%">个资源点的坐标为</span><span style="line-height: 150%">(i=1..n),</span><span style="line-height: 150%">你需要计算有多少个<b>四元组</b></span><b><span style="line-height: 150%">(LB,DB,RB,UB)</span></b><b><span style="line-height: 150%">满足</span></b><b><span style="line-height: 150%">1&lt;=LB&lt;=RB&lt;=R,1&lt;=DB&lt;=UB&lt;=C</span></b><b><span style="line-height: 150%">，且存在一个</span></b><b><span style="line-height: 150%">i</span></b><b><span style="line-height: 150%">使得</span></b></span></div>
<div style="line-height: 150%"><span style="font-size: medium"><b><span style="line-height: 150%">LB&lt;=Xi&lt;=RB,DB&lt;=Yi&lt;=UB</span></b></span></div>
<div style="line-height: 150%"><span style="font-size: medium"><b><span style="line-height: 150%">均成立</span></b><span style="line-height: 150%">。</span></span></div></p><hr/><h3>样例输入</h3><pre>      5 5 4
     1 2
     2 3
     3 5
     4 1
</pre><hr/><h3>样例输出</h3><pre>139
</pre><hr/><h3>提示</h3><p><p>【数据范围】<br />
对于100%的数据，R,C&lt;=40000,N&lt;=100000，资源点的位置两两不同，且位置为随机生成。</p></p><hr/><h3>题目来源</h3><p>没有写明来源</p>
								</div>
							</div>
						</div>
					</div>
				</div>
				
				
			</section>
		</div>
	</main>

	<div class="fbtn-container">
		<div class="fbtn-inner">
			<a class="fbtn fbtn-lg fbtn-brand-accent waves-attach waves-circle waves-light waves-effect" data-toggle="dropdown" aria-expanded="true"><span class="fbtn-text fbtn-text-left">Menu</span><span class="fbtn-ori icon">apps</span><span class="fbtn-sub icon">close</span></a>
			<div class="fbtn-dropup">
				<a class="fbtn fbtn-brand waves-attach waves-circle waves-light waves-effect" href="../list.html" target="_self"><span class="fbtn-text fbtn-text-left">题目列表</span><span class="icon">menu</span></a>
				<a class="fbtn fbtn-green waves-attach waves-circle waves-effect" href="../index.html" target="_self"><span class="fbtn-text fbtn-text-left">返回主页</span><span class="icon">home</span></a>
				<a class="fbtn waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/submitpage.php?id=2658" target="_blank"><span class="fbtn-text fbtn-text-left">提交代码</span><span class="icon">send</span></a>
				<a class="fbtn fbtn-orange waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/wttl/wttl.php?pid=2658" target="_blank"><span class="fbtn-text fbtn-text-left">试题讨论</span><span class="icon">chat</span></a>
				
			</div>
		</div>
	</div>

	<!-- js -->
	<script src="../js/jquery.min.js"></script>
	<script src="../js/base.min.js"></script>
	<script src="../js/project.min.js"></script>
</body>
</html>